package com.victor.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.victor.entity.Manager;

@Mapper
public interface ManagerDao {

	/**
	 * 验证是否存在该账号
	 * 
	 * @param m_account
	 * @return
	 */
	@Select({ "select * from manager where m_account=#{m_account}" })
	Manager loginexistmanager(@Param("m_account") String m_account);

	/**
	 * 登录方法
	 * 
	 * @param manager
	 * @return
	 */
	@Select({ "select * from manager where m_account=#{m_account} and m_password=#{m_password}" })
	Manager loginManager(Manager manager);

	/**
	 * 修改密码
	 * 
	 * @param manager
	 * @return
	 */
	@Update({ "update manager set m_password=#{m_password} where id=#{id}" })
	int updManagerPassword(Manager manager);

	/**
	 * 通过id查询原密码
	 * 
	 * @param id
	 * @return
	 */
	@Select({ "select * from manager where id=#{id}" })
	Manager getManagerByid(@Param("id") Integer id);
}
